/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.unisc.pdaapp.server.webservice;

import com.twmacinta.util.MD5;

/**
 *
 * @author guilherme
 */
public class Main
{
    private MoodleMobileWS moodleWS = new MoodleMobileWS();

    public Main()
    {
        //        byte plain[] = "a5d3eb31641407333612861ef578265a".getBytes();

        byte plain[] = "cateto.".getBytes();

        // create MD5 object\
        MD5 md5 = new MD5(plain);

        //get the resulting hashed byte
        byte[] result = md5.doFinal();

        //convert the hashed byte into hexadecimal character for display
        String hashResult = MD5.toHex(result);

        System.out.println("pwd: " + hashResult);

        int login = moodleWS.doLogin("admin", hashResult);
        System.out.println("login: " + login);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
    {
        new Main();

    }
}
